package com.example.mtblog.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserAuthority {

    private Integer uid;


    private Boolean isHavePublishArticleAuth; //是否拥有发布文章权限
    private Integer userDayPublishArticleNum;  //用户当天发布文章数量
    private Integer userDayPublishArticleNumLimit;//一天上传限制
    private Integer userTotalPublishArticleNum; //用户总共发布文章数量


    private Boolean isHaveDiscussArticleAuth; //是否拥有评论文章权限

    private Boolean isHaveSearchArticleAuth; //是否拥有搜索文章权限

    private Boolean isHaveChatAuth; //是否拥有聊天权限



    public void init(UserAuthority userAuthority){

        //发布文章
        userAuthority.isHavePublishArticleAuth = false;
        userAuthority.userDayPublishArticleNum = 0;
        userAuthority.userDayPublishArticleNumLimit = 5;
        userAuthority.userTotalPublishArticleNum = 0;

        //评论文章
        userAuthority.isHaveDiscussArticleAuth = false;


        //搜索文章
        userAuthority.isHaveSearchArticleAuth = false;


        //聊天
        userAuthority.isHaveChatAuth = false;
    }
}


